/*
 * @(#) NumberEditor.java 2013-7-19 上午10:47:41
 *
 * Copyright 2013 Rockwell Automation, Inc. All rights reserved.
 * Rockwell Automation PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */package com.osi.mes.base.control;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import com.datasweep.plantops.property.editor.NumberPropertyEditor;

public class NumberEditor extends NumberPropertyEditor implements MouseListener
{
	NumberInputPanel simulatePanel = null;
	public NumberEditor()
	{
		super();
		simulatePanel = new NumberInputPanel(this);
		addMouseListener(this);
	}

	@Override
	public void mouseClicked(MouseEvent e)
	{
		simulatePanel.setVisible(false);
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取当前屏幕大小
		Dimension frameSize = simulatePanel.getPreferredSize();// 获取当前窗口大小
		simulatePanel.setLocation(
			(screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height)/2);
		simulatePanel.setVisible(true);
	}

	@Override
	public void mousePressed(MouseEvent e)
	{
		
	}

	@Override
	public void mouseReleased(MouseEvent e)
	{
		
	}

	@Override
	public void mouseEntered(MouseEvent e)
	{
	}

	@Override
	public void mouseExited(MouseEvent e)
	{
	}
}
